package com.smcdd.cdb.dbo.cdb_dbo.ui.fragment;

/**
 * 作者：Administrator on 2017/6/20 11:55
 * 邮箱：zhanghuaiha@gmail.com
 */

public class FragmentFactory {
    static FragmentFactory mInstance;
    private FragmentFactory(){}

    public static FragmentFactory getInstance() {
        if (mInstance == null) {
            synchronized (FragmentFactory.class) {
                if (mInstance == null) {
                    mInstance = new FragmentFactory();
                }
            }
        }
        return mInstance;
    }

    private YetLayMenFragment yetLayMenFragment;
    private NotLayMenFragment notLayMenFragment;
    private MenDianListFragment menDianListFragment;
    private MenDianMapFragment menDianMapFragment;
    private ReachYetFragment reachYetFragment;
    private ReachNotFragment reachNotFragment;

    /**
     * 门店列表
     * @return
     */
    public MenDianListFragment getMenDianListFragment() {
        if (menDianListFragment == null) {
            synchronized (MenDianListFragment.class) {
                if (menDianListFragment == null) {
                    menDianListFragment = new MenDianListFragment();
                }
            }
        }
        return menDianListFragment;
    }


    /**
     * 门店地图
     * @return
     */
    public MenDianMapFragment getMenDianMapFragment() {
        if (menDianMapFragment == null) {
            synchronized (MenDianMapFragment.class) {
                if (menDianMapFragment == null) {
                    menDianMapFragment = new MenDianMapFragment();
                }
            }
        }
        return menDianMapFragment;
    }



    /**
     * 已铺设fragment
     * @return
     */
    public YetLayMenFragment getYetLayMenFragment() {
        if (yetLayMenFragment == null) {
            synchronized (YetLayMenFragment.class) {
                if (yetLayMenFragment == null) {
                    yetLayMenFragment = new YetLayMenFragment();
                }
            }
        }
        return yetLayMenFragment;
    }

    /**
     * 待铺设fragment
     * @return
     */
    public NotLayMenFragment getNotLayMenFragment() {
        if (notLayMenFragment == null) {
            synchronized (NotLayMenFragment.class) {
                if (notLayMenFragment == null) {
                    notLayMenFragment = new NotLayMenFragment();
                }
            }
        }
        return notLayMenFragment;
    }

    /**
     * 已达标fragment
     * @return
     */
    public ReachYetFragment getReachYetFragment() {
        if (reachYetFragment == null) {
            synchronized (ReachYetFragment.class) {
                if (reachYetFragment == null) {
                    reachYetFragment = new ReachYetFragment();
                }
            }
        }
        return reachYetFragment;
    }

    /**
     * 未达标fragment
     * @return
     */
    public ReachNotFragment getReachNotFragment() {
        if (reachNotFragment == null) {
            synchronized (ReachNotFragment.class) {
                if (reachNotFragment == null) {
                    reachNotFragment = new ReachNotFragment();
                }
            }
        }
        return reachNotFragment;
    }
}
